Benjamin Otte [Thu, 11 Nov 2021 04:21:43 +0000 (05:21 +0100)]
label: Don't do more work than necessary
We only want to determine the size pixel-exact, not pango-unit-exact, so
don't spend lots of time wondering if text is half a pixel or a quarter
pixel wider.
Benjamin Otte [Wed, 10 Nov 2021 19:01:36 +0000 (20:01 +0100)]
build: Don't use any -Werror in release builds
Do kep them for debug and debugoptimized builds though.
Keeping -Werror flags in release builds causes issues with forward
compatibility, when new compiler releases or different toolchains
suddenly cause those warnings to be emitted during compilation.
While we certainly want those issues to be investigated and fixed, they
should not prevent anyone from building GTK until they are.
Matthias Clasen [Tue, 9 Nov 2021 20:25:48 +0000 (15:25 -0500)]
flatpak: Add pango to manifest
We have a tight coupling with pango, whenever new
pango API appears, our build usually breaks. So
just make our flatpak manifests build pango from git.
Benjamin Otte [Tue, 9 Nov 2021 02:28:29 +0000 (03:28 +0100)]
boxlayout: Fix broken min-size-for-opposite-size
Assume a vbox with 2 wrapping labels saying
Hello World
Hi Ho
being measured for their minimum width for 3 rows of text.
This should be layouted like
Hello
World
Hi Ho
and measured accordingly.
However, previously this was layouted as
Hello World
Hi Ho
with 1.5 lines being assigned to both labels.
That will obviously not compute the above wrapping which clearly
results in a smaller min width.
Matthias Clasen [Mon, 8 Nov 2021 13:08:19 +0000 (08:08 -0500)]
css: Change the way case variants are handled
Instead of translating font-variant-caps directly
to OpenType features, translate them to a PangoVariant,
now that that enumeration reflects all the css values.
This allows pango to emulate Small Caps for fonts that
don't support the OpenType feature.
Matthias Clasen [Fri, 5 Nov 2021 22:54:06 +0000 (18:54 -0400)]
textview: Don't leave embedded children behind
When scrolling embedded widgets out of view,
they sometimes get left behind because we don't
reallocated them. To avoid that, move _all_ children
out of view in size_allocate, and let the current
child allocation plumbing move the visible ones
back in place.
Benjamin Otte [Sat, 6 Nov 2021 02:38:03 +0000 (03:38 +0100)]
reftests: Add reftest for last 2 issues
Use a label that is long enough to require wrapping and force it into a
hardcoded width. Use a sentence where all the words have the same size
to not get unwanted wrapping behavior.
Also append a 2nd row to check that the first row gets the proper height
allocated.
Benjamin Otte [Sat, 6 Nov 2021 02:15:04 +0000 (03:15 +0100)]
label: Don't deduce label width from logical rect
The width of a logical rect after line breaking is sometimes not
wide enough to cause line breaking to break at the exact same points.
(Is that by design or a bug in Pango? I don't know.)
So don't use the width, and only relyon values we actually set to
pango_layout_set_width().
Benjamin Otte [Fri, 5 Nov 2021 19:30:49 +0000 (20:30 +0100)]
boxlayout: Compute opposite size properly
For size -1 in the opposite orientation, GtkBoxLayout used to measure
the children based on their min size in the box's orientation instead of
-1. That wasn't really intended, but was a side effect of how the sizing
code did (not) distribute extra size above the minimum size.
This is clearly not what we want.
What we want is measuring the orientation as is for size -1. Then we
want to just take the maximum of all children and use that.
A reftest is incldued that ensures a vbox wraps a label just like an
hbox does.
Benjamin Otte [Thu, 4 Nov 2021 14:56:37 +0000 (15:56 +0100)]
label: Redo measure() code
The old code couldn't properly do height-for-width because it only
computed the widest and smallest layout instead of looking at the actual
passed in for-size.
The label-sizing reftest has been adapted as the label code is now smart
enough to always display the whole text and no longer requests a too
small width-for-single-row when wrapping.
Carlos Garnacho [Thu, 4 Nov 2021 13:40:21 +0000 (14:40 +0100)]
gdk/wayland: Do not use xdg_wm_base.ping serials as "user input" serials
Ping/pong serials are not meant to be interpreted as user input serials
(e.g. those given back later to the compositor on grabs). As a matter
of fact, Mutter uses a different count (i.e. timestamps) in these, so
using these serials may confuse the compositor into denying certain
operations like DnD.
The change was meant to revert to old GTK3 behavior but it actually
broke new GTK4 behavior that is in use where max-width-chars is used to
determine an ideal size, but where we don't want to limit the width to
that size.
So what happens is the reintroduction of GTK3-style lots of whitepsace
bugs, and we really don't want those.
We also don't want to break backwards compat if we can avoid it.
So let's revert this.
The reftest that was made for this purpose has been adapted.
Benjamin Otte [Wed, 3 Nov 2021 18:49:57 +0000 (19:49 +0100)]
egl: Set the draw buffer to GL_BACK_LEFT
Instead of using GL_BACK, use GL_BACK_LEFT, because the spec demands
this (many drivers don't).
Also move the call from the GDK backends into the GLContext code, as
this is a generic EGL issue (nvidia being the main driver in need of
this call, see 9c4c4eaaa121d784f591a591b95264647eaece96 for a longer
discussion).
Tobias Bernard [Mon, 1 Nov 2021 17:54:22 +0000 (18:54 +0100)]
icon: revert object-symbolic check to be smaller
The larger check works well in the headerbar, but not inline in various UI elements. This reverts the larger check since the latter is more common. For selection mode, a separate larger icon (selection-mode-symbolic) has been added to adwaita-icon-theme.